import string
import threading
import time

from xjlibrary.database_moudel.simple_test.mysql_client import MySqlDbConnect, ExeSqlList

mysql = MySqlDbConnect("./mysql.ini", "mysqllocalhost")

sSqlList = []
sSqlList2 = []


for i in range(0, 5):
    sql = "insert into `user` (username) values('{}') ".format(i)
    sSqlList.append(sql)

for i in string.ascii_lowercase:
    sql = "insert into `user` (username) values('{}') ".format(i)
    sSqlList2.append(sql)


def test1():
    global mysql
    ExeSqlList(sSqlList, mysql)


def test2():
    global mysql
    ExeSqlList(sSqlList2, mysql)

t =threading.Thread(target=test1)
t1 =threading.Thread(target=test2)
t.start()
time.sleep(1)
t1.start()


